{extend name="admin/base" /}
{block name="resources"/}
<style type="text/css">
.required{
	color:red;margin-right:10px;
}
</style>
{/block}
{block name="main"}
<div class="set-style">
	<dl>
		<dt><span class="required">*</span>物流公司名称:</dt>
		<dd>
			<p>
				<input id="company_name" type="text" value="">
			</p>
			<p class="error">请输入物流公司名称</p>

		</dd>
	</dl>
	<dl>
		<dt>物流公司编号:</dt>
		<dd>
			<p><input id="express_no" type="text"></p>
		</dd>
	</dl>
	<dl>
		<dt>联系电话:</dt>
		<dd>
			<p><input id="phone" type="text"></p>
			<p class="error">联系电话格式不正确</p>
		</dd>
	</dl>
	<dl>
		<dt>物流公司logo:</dt>
		<dd>
			<div class="class-logo">
				<p>
					<img id="imglogo" src="">
				</p>
			</div>
			<div class="ncsc-upload-btn">
				<a href="javascript:void(0);">
					<span>
						<input hidefocus="true" size="1" class="input-file" name="file_upload" id="uploadImg" type="file" onchange="imgUpload(this);">
						<input type="hidden" id="logo" value="" />
					</span>
					<p><i class="fa fa-cloud-upload text"></i>上传图片</p>
				</a>
			</div>
			<p class="hint">
				<br><span style="color: orange;">建议使用宽100像素-高100像素内的GIF或PNG透明图片；点击下方"提交"按钮后生效。</span>
			</p>
		</dd>
	</dl>
	<dl>
		<dt>排序:</dt>
		<dd>
			<p><input id="orders" type="number"></p>
			<p class="error">请输入排列序号</p>
		</dd>
	</dl>
	<dl>
		<dt>是否启用物流:</dt>
		<dd><input id="is_enabled" type="checkbox" class="checkbox" checked="checked" /></dd>
	</dl>
	
	<dl>
		<dt>是否设置为默认:</dt>
		<dd><input id="is_default" type="checkbox" class="checkbox"/></dd>
	</dl>
	<button class="edit_button" onclick="addExpressCompanyAjax();">提交</button>
</div>
<script src="ADMIN_JS/ajax_file_upload.js" type="text/javascript"></script>
<script src="__STATIC__/js/file_upload.js" type="text/javascript"></script>
<script src="ADMIN_JS/express/add_express_company.js"></script>
<script>
/**
	 *图片上传
	 */
	function imgUpload(event) {
		var fileid = $(event).attr("id");
		var data = { 'file_path' : UPLOADCOMMON };
		uploadFile(fileid,data,function(res){
			if(res.code){
				$("#imglogo").attr("src","__UPLOAD__/"+res.data);
				$("#logo").val(res.data);
				showTip(res.message,"success");
			}else{
				showTip(res.message,"error");
			}
		});
	}
</script>
{/block}